home *** CD-ROM | disk | FTP | other *** search
- #include <ezycom.h>
- #include <ezylib.h>
-
- /**********************************************************
- * Convert a Date to a Word
- *
- * Returns the converted date on success or 65535 on failure.
- *
- * eg: worddate = date2word(1992,1,1);
- **********************************************************/
- word Date2Word(word yy, word mm, word dd)
- {
- word tofield=0;
-
- if (!CheckDate(yy,mm,dd) || yy < 1980 || yy > 2107) return(65535U);
-
- tofield = dd-1;
- tofield = tofield + ((mm-1) << 5);
- tofield = tofield + ((yy-1980) << 9);
-
- return(tofield);
- }
-